package domain.model.project.support.projectdeveloper;

import domain.model.project.ProjectDeveloper;
import shared.model.BuilderObject;

import java.util.Collections;
import java.util.List;

/**
 * @author Gregory Boissinot
 */
public class ProjectDeveloperBuilder implements BuilderObject<ProjectDeveloper> {

    private RWProjectDeveloper projectDeveloper;

    public ProjectDeveloperBuilder(String id) {
        this.projectDeveloper = new ProjectDeveloperImpl(id);
    }

    public ProjectDeveloperBuilder name(String name) {
        this.projectDeveloper.setName(name);
        this.projectDeveloper.setRoles(Collections.EMPTY_LIST);
        return this;
    }

    public ProjectDeveloperBuilder email(String email) {
        this.projectDeveloper.setEmail(email);
        return this;
    }

    public ProjectDeveloperBuilder url(String url) {
        this.projectDeveloper.setUrl(url);
        return this;
    }

    public ProjectDeveloperBuilder organization(String organization) {
        this.projectDeveloper.setOrganization(organization);
        return this;
    }

    public ProjectDeveloperBuilder organizationUrl(String organizationUrl) {
        this.projectDeveloper.setOrganizationUrl(organizationUrl);
        return this;
    }

    public ProjectDeveloperBuilder timezone(String timezone) {
        this.projectDeveloper.setTimezone(timezone);
        return this;
    }

    public ProjectDeveloperBuilder roles(List<String> roles) {
        this.projectDeveloper.setRoles(roles);
        return this;
    }

    @Override
    public ProjectDeveloper build() {
        return this.projectDeveloper;
    }
}
